package com.hanamaki.study.day02.paramters;

import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.AfterClass;

public class TestAddParamters {

    CalcAdd c ;

    @BeforeClass
    public void beforeClass() {
        c= new CalcAdd();
    }


    @Test(dataProvider="dp1")
    public void f(String a,String b,String exp) {
        int act = c.calc_add(Integer.parseInt(a),Integer.parseInt(b));
        System.out.println(act);

        Assert.assertEquals(act, Integer.parseInt(exp));
    }



    @AfterClass
    public void afterClass() {

    }

    @DataProvider
    public Object[][] dp1() {
        return new Object[][]{
                new Object[]{"1","2","3"},
                new Object[]{"2","2","5"},
                new Object[]{"1","8","9"}
        };
    }

}
